#include "fig_miniboss_plato.h"
#include "fig_enemybullet_master.h"
#include "fighter.h"

#include "num/rand.h"
#include "math/facing.h"



FIGMiniBossPlato::FIGMiniBossPlato(FIGEnemyCraft::ENEMY_TYPES EnemyType) : 
							FIGEnemyMiniBoss(										
										EnemyType
										)
{
	
	m_ShootCounter.SetLimit(2.0f);
	m_Accel = 1.0f;	
	m_MaxAttackCount = 8;
}





void			FIGMiniBossPlato::OnShootStyle1()
{
							
	for( int j = 0; j < 3; j++)
	{
		for(int i = 0; i <4; i++)
		{
			FIGEnemyBulletMaster::Instance().Shoot(
												this,
												m_Bone.GetPosByWayPoint(i),
												FIGEnemyBulletMaster::BULLET_TYPE_CIRCLE_DOUBLELAYER,
												FIGBullet::SHOOT_STYLES_SINGLE,
												180,		// degree
												j * 0.3f,
												false,
												NULL
          										);
		}
	}

	


	


}

void			FIGMiniBossPlato::OnShootStyle2()
{
	for( int i = 0; i < 3; i++)
	{
		FIGEnemyBulletMaster::Instance().Shoot(
												this,
												m_Bone.GetPosByWayPoint(0),
												FIGEnemyBulletMaster::BULLET_TYPE_CIRCLE_TRIPPLELAYER,
												FIGBullet::SHOOT_STYLES_SINGLE,
												180,		// degree
												i * 0.25f,
												false,
												NULL
          										);	
		FIGEnemyBulletMaster::Instance().Shoot(
												this,
												m_Bone.GetPosByWayPoint(3),
												FIGEnemyBulletMaster::BULLET_TYPE_CIRCLE_TRIPPLELAYER,
												FIGBullet::SHOOT_STYLES_SINGLE,
												180,		// degree
												i * 0.25f,
												false,
												NULL
          										);

		FIGEnemyBulletMaster::Instance().Shoot(
												this,
												m_Bone.GetPosByWayPoint(1),
												FIGEnemyBulletMaster::BULLET_TYPE_CIRCLE_DOUBLELAYER,
												FIGBullet::SHOOT_STYLES_SINGLE,
												180,		// degree
												i * 0.15f,
												false,
												NULL
          										);	
		FIGEnemyBulletMaster::Instance().Shoot(
												this,
												m_Bone.GetPosByWayPoint(2),
												FIGEnemyBulletMaster::BULLET_TYPE_CIRCLE_DOUBLELAYER,
												FIGBullet::SHOOT_STYLES_SINGLE,
												180,		// degree
												i * 0.15f,
												false,
												NULL
          										);
	}
}

void		FIGMiniBossPlato::Tick_RotateBack(float dt)
{
	FIGEnemyMiniBoss::Tick_RotateBack(dt);
	m_MiniBossState = MINIBOSS_STATE_GOBACK;
	m_Speed = 0.0f;

	m_MiniBossState = MINIBOSS_STATE_GOBACK;
	if(m_Pos.x < 0.5f)
		m_GoBackDir = math::Facing::VectorFromAngle(180-125);
	else
		m_GoBackDir = math::Facing::VectorFromAngle(180+125);
}

